package ui;
/**
 * This class provides the constants used from the application,
 * such as messages, commands names and syntax and error messages
 * @author Cipri Lucaci
 * @author Rustem Bekmukhametov
 * @author Alba Xhani
 */
public abstract class Constants {
	public static abstract class SETTINGS{
		public static final String  SERVER_IP   = "131.159.52.1";
		public static final int 	SERVER_PORT = 50000; 
		public static final String PATTERN = 
		        "^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
		        "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
		        "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
		        "([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";
		public static final int SOCKET_TIMEOUT = 5000;  

	}
	
	public static abstract class COMMANDS{
		public static final String CONNECT 		= "connect";
		public static final String DISCONNECT 	= "disconnect";
		public static final String SEND 		= "send";
		public static final String HELP 		= "help";
		public static final String QUIT 		= "quit";
		public static final String LOG_LEVEL 	= "logLevel";
	}
	
	public static abstract class HELP{
		public static final String CONNECT 		= "connect <server_ip> <port> - establishes connection with the specified server\n";
		public static final String DISCONNECT 	= "disconnect - aborts connection with the server\n";
		public static final String SEND 		= "send <textmessage> - sends the given text message to the currently connected echo server\n";
		public static final String HELP 		= "help <command> - shows the function of the command\n";
		public static final String QUIT 		= "quit - tears down the active connection to the server and exits the program execution\n";
		public static final String LOG_LEVEL 	= "logLevel <log_level_value> - changes the logging level to the parameter indicated: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL\n";
	}
	
	public static abstract class MESSAGES{
		public static final String HELP 				= "some info";
		public static final String CONNECTION_SUCCEEDED = "connection successfully established";
		public static final String CONNECTION_TERMINATED= "connection terminated: 131.159.52.1 / 50000";
		public static final String APPLICATION_QUIT		= "Application Exit!";
	}
	
	public static abstract class ERRORS{
		public static final String UNRECOGNIZED_COMMAND 	= "ERROR: unrecognized command! Use <help> for the syntax ";
		public static final String INVALID_ARGUMENT 		= "ERROR: invalid arguments passed to the command";
		public static final String CONNECTION_NOT_SUCCEEDED	= "ERROR: a problem occured during the connection. Please verify the connection settings";
		public static final String NO_CONNECTION			= "ERROR: no connection established";
		public static final String SOCKET_TIMEOUT			= "ERROR: connection timeout exceeded";
		public static final String DISCONNECTION_NOT_SUCCEEDED			= "ERROR: disconnection failed";
		public static final String DISCONNECT_FIRST 					= "WARNING: You are already connected! Please disconnect first!";
	}
}
